﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMasterPage.master" AutoEventWireup="true" ValidateRequest="false"
    CodeFile="AddNews.aspx.cs" Inherits="Admin_AddNews" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="Header" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
    <script type="text/javascript" language="javascript">
        function onCancel() {
            return false;
        }
    </script>
    <script type="text/javascript">
        window.onload = function () {
            CKEDITOR.replace('ctl00_ContentPlaceHolder1_txtContent');
        }
 </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div id="categorytree" class="tree">
        <asp:DropDownList runat="server" ID="ddlLanguageChoose" AutoPostBack="true" OnSelectedIndexChanged="ddlLanguageChoose_SelectedIndexChanged">
            <asp:ListItem Text="Русский" Value="1"></asp:ListItem>
            <asp:ListItem Text="עברית" Value="2"></asp:ListItem>
        </asp:DropDownList>
        <asp:Button runat="server" ID="btnNew" Text="Новая статья" OnClick="btnNew_Click" />
        <br />
        <br />
        <asp:DataList runat="server" ID="dlEvents" OnItemDataBound="dlEvents_ItemDataBound">
            <ItemTemplate>
                <div style="background-color: White; color: Black;">
                    <asp:Label runat="server" ID="lblDate" Text='<%# Eval("Title") %>'></asp:Label>
                    <asp:ImageButton runat="server" ID="imgUpdate" CommandArgument='<%# Eval("ID")%>'
                        AlternateText="Edit" ToolTip="Редактировать" ImageUrl="~/Admin/images/edit.png"
                        OnClick="btnEditEvent_Click" />
                    <asp:ImageButton runat="server" ID="imgDelete" CommandArgument='<%# Eval("ID")%>'
                        AlternateText="Delete" ToolTip="Удалить" ImageUrl="~/Admin/images/delete.png"
                        OnClick="imgDelete_Click" />
                </div>
            </ItemTemplate>
        </asp:DataList>
    </div>
    <div id="content">
        <h2>
            Добавить статью</h2>
        <fieldset>
            <div>
                <asp:HiddenField runat="server" ID="hfEventID" />
                <asp:Label runat="server" AssociatedControlID="txtTitle">Заголовок :</asp:Label>
                <asp:TextBox ID="txtTitle" runat="server" TextMode="SingleLine" Columns="80"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rfvPageSummary" runat="server" ControlToValidate="txtTitle"
                    Text="&#9679;" ErrorMessage="● Поле необходимое для заполнения" Display="Dynamic"
                    ValidationGroup="Send"></asp:RequiredFieldValidator>
            </div>
            <div>
                <asp:Label ID="Label3" runat="server" AssociatedControlID="txtSubTitle">Краткое описание:</asp:Label>
                <asp:TextBox ID="txtSubTitle" runat="server" TextMode="MultiLine" Columns="80" Rows="5"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSubTitle"
                    Text="&#9679;" Display="Dynamic" ValidationGroup="Send"></asp:RequiredFieldValidator>
            </div>
            <div>
                <asp:Label runat="server" AssociatedControlID="txtContent">Содержание</asp:Label>
                <asp:TextBox runat="server" ID="txtContent" Width="651px" Height="228px" TextMode="MultiLine"></asp:TextBox>
            </div>
            <div id="thumbnail" runat="server">
                <img runat="server" id="imgPreview" style="width: 588px; height: 100px;" />
                <br />
                <asp:Label ID="Label6" runat="server" AssociatedControlID="uplImage">Изменить картинку 588x100:</asp:Label>
                <ajax:AsyncFileUpload runat="server" ID="uplImage" Width="400px" CompleteBackColor="White"
                    UploadingBackColor="#CCFFFF" ThrobberID="imgLoader" OnUploadedComplete="uplImage_UploadedComplete" />
                <asp:Image ID="imgLoader" runat="server" ImageUrl="~/Images/loading.gif" />
            </div>
            <div id="Div1" runat="server">
                <img runat="server" id="imgThumbPreview" style="width: 120px; height: 120px;" />
                <br />
                <asp:Label ID="Label1" runat="server" AssociatedControlID="uplImage">Изменить картинку 120x120:</asp:Label>
                <ajax:AsyncFileUpload runat="server" ID="uplThumbImage" Width="400px" CompleteBackColor="White"
                    UploadingBackColor="#CCFFFF" ThrobberID="imgThumbLoader" OnUploadedComplete="uplThumbImage_UploadedComplete" />
                <asp:Image ID="imgThumbLoader" runat="server" ImageUrl="~/Images/loading.gif" />
            </div>
            <asp:ValidationSummary ID="vsSummary" runat="server" CssClass="error" ValidationGroup="Send"
                DisplayMode="List" />
            <asp:Button ID="btnSave" runat="server" Text="Сохранить" OnClick="btnSave_Click"
                ValidationGroup="Send" />
        </fieldset>
    </div>
</asp:Content>
